<?php
/**
 *
 * User: wufeng
 * Date: 2020/06/24
 */

namespace app\web\controller;

use app\common\controller\Web;
use app\common\model\Company;
use app\common\model\CooperateModel;
use app\common\model\Link;

/**
 * 关于我们
 * User: wufeng
 * Date: 2020/06/24
 * @package app\home\controller
 */
class About extends Web
{
	public function about()
	{
		//公司介绍
		$company = (new Company())->get(1);
		$company['pic'] = _sImage($company['pic']);
		$this->assign('company', $company);
		//公司宗旨
		$aimList = (new Company())->where(['type' => 2])->select();
		$this->assign('aimList', $aimList);
		//为什么选择三叶虫
		$whyList = (new Company())->where(['type' => 3])->select();
		foreach ($whyList as $item){
			$item['pic'] = _sImage($item['pic']);
		}
		$this->assign('whyList', $whyList);

		$scienceList = (new Company())->where(['type' => 10])->select();
		foreach ($scienceList as $item){
			$item['pic'] = _sImage($item['pic']);
		}
		$this->assign('scienceList', $scienceList);

		$employ = (new Link())->get(['position' => 11]);
		$this->assign('employ', $employ);

		$this->assign('intro', (new Company())->get(33));
		return view('about');
	}

	public function contact()
	{
		//介绍
		$intro = (new Company())->where(['type' => 4])->find();
		$this->assign('intro', $intro);
		//服务
		$otherList = (new Company())->where(['type' => 5])->select();
		foreach ($otherList as $item){
			$item['pic'] = _sImage($item['pic']);
			$item['code_pic'] = _sImage($item['code_pic']);
		}
		$this->assign('otherList', $otherList);
		$employ = (new Link())->get(['position' => 12]);
		$this->assign('employ', $employ);
		return view('contact');
	}

	public function join_us()
	{
		return view('join_us');
	}
}